/**
 * 
 */
package com.album.utils;

import java.util.Calendar;

import java.util.Calendar;

import android.util.Log; 
public class MyLog {
	private static final String LOG_TAG="log";
	/**
	 * 是否输出log
	 */
	private static  boolean flgs = true;
	
	
	/**
	 * info打印调试信息<br/>
	 * @param clazz
	 * @param info void
	 * @exception 
	 * @since  1.0.0
	 */
	public static final void info(Class clazz,String info){
		if(flgs) Log.i(LOG_TAG,">>>>>>>>>>>"+clazz.getSimpleName()+" "+info);
	}
	/**
	 * 
	 * error打印错误信息<br/>
	 * @param clazz
	 * @param error
	 * @param t void
	 * @exception 
	 * @since  1.0.0
	 */
	public static final void error(Class clazz,String error,Throwable t){
		if(flgs) Log.e(LOG_TAG,">>>>>>>>>>>"+clazz.getSimpleName()+" "+error, t);
	}
	
	/**
	 * 
	 * error打印错误信息<br/>
	 * @param clazz
	 * @param error
	 * @param t void
	 * @exception 
	 * @since  1.0.0
	 */
	public static final void error(Class clazz,String error){
		if(flgs) Log.e(LOG_TAG,">>>>>>>>>>>"+clazz.getSimpleName()+" "+error);
	}
	
	public static final void debug(Class clazz,String info){
		if(flgs) Log.d(LOG_TAG,">>>>>>>>>>>"+clazz.getSimpleName()+" "+info);
	}
	
	public void setLog(boolean flgs){
		this.flgs = flgs;
	}
	/**
	 * 
	 * getCurrentTimeString获取当前时间<br/>
	 * @return String
	 * @exception 
	 * @since  1.0.0
	 */
	public static final String getCurrentTimeString(){
		Calendar calendar = Calendar.getInstance();
		String created = calendar.get(Calendar.YEAR)+"-"
		+ calendar.get(Calendar.MONTH)+1+ "-"
		+ calendar.get(Calendar.DAY_OF_MONTH)+" "
		+ calendar.get(Calendar.HOUR_OF_DAY)+":"
		+ calendar.get(Calendar.MINUTE)+":"
		+ calendar.get(Calendar.SECOND)+":"
		+ calendar.get(Calendar.MILLISECOND);
		return created;
	}
}